<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--<%@ page import="com.iWen.survey.dao.DAOFactory"%>
<%@ page import="com.iWen.survey.dto.Answersheet" %>
<%@ page import="com.iWen.survey.dao.AnswersheetDAO" %>
<%@ page import="com.iWen.survey.pager.*" %>
<jsp:useBean id="pageConfig" class="com.iWen.survey.pager.PageConfig"></jsp:useBean>--%>
<%--<jsp:setProperty property="request" name="pageConfig" value="<%=request %>"/>--%>
<%--<%
	AnswersheetDAO dao=DAOFactory.getAnswersheetDAO();
	PageControl pc=new PageControl(dao,pageConfig,"ShowSheets.jsp?rand=1");
	pc.setSizePage(20);
	List<Answersheet> aList=pc.getRecord();
 %> --%>
<%--<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>--%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'SurveyAudi.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/Css/Admin.css">
	  <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/Css/bootstrap.min.css">
	  <script language="JavaScript" src="${pageContext.request.contextPath}/Js/jquery-1.7.2.js"></script>
	  <script language="JavaScript" src="${pageContext.request.contextPath}/Js/Func.js"></script>
	<script language="javascript">window.onload=tableFix;</script>
<script type="text/javascript">
    function DelSheet(asid,sid){
        if(confirm("确定要删除这个答卷吗？")==true){

           /* /!*window.location="/surveyManage/Delete?asid="+asid+"&sid="+sid;*!/*/
            $.post("/surveyManage/Delete?asid="+asid+"&sid="+sid,function (data) {
                if (data.code==200){
                    alert(data.msg)
                    window.location.href="${pageContext.request.contextPath}/surveyManage/ShowSheets/${sid}?pageCode=1";
                }else {
                    alert(data.msg)
                }

            }, "json")}
    }
</script>
  </head>

  <body>
 <div class=nav style="text-align:left"><a href=/admin/admin_main.jsp>桌面</a>»<a href=/admin/SurveyStatis.jsp>问卷列表</a>»答卷列表
 <hr>
 </div>   
 <table class=table cellspacing="0" cellpadding="0" align="center">
<tbody><tr>
<th width=7%>编号</th>
<th width=20%>提交日期</th>
<th width=15%>用户IP<br></th>
<th>操作 <br></th></tr>

<c:forEach items="${pageBean.list}" var="answersheet">

	<tr>
		<td>${answersheet.id}</td>
		<td>${answersheet.postdate}</td>
		<td>${answersheet.userip}</td>

		<td><%--<a href=${pageContext.request.contextPath}/surveyManage/ShowSheet?asid=${answersheet.id}&sid=${answersheet.fkSurvey}>查看</a>|--%><a href="javascript:DelSheet(${answersheet.id},${answersheet.fkSurvey})">删除</a></td>
	</tr>

	<%--<tr> <td colspan=7 align="right"><%=pc.getCurrentPageHTML() %><%=pc.getCountPageHTML() %>|<%=pc.getFirstPageHTML() %>|<%=pc.getPageUpHTML() %>|<%=pc.getPageDownHTML() %>|<%=pc.getLastPageHTML() %></td></tr>&ndash;%&gt;

--%>

</c:forEach>
<%--<%

for(Answersheet answersheet:aList){
 %>
<tr>
<td><%=answersheet.getAsId() %></td>
<td><%=answersheet.getAsPostdate() %></td>
<td><%=answersheet.getAsUserIp() %></td>
<td><a href=/admin/ShowSheet.jsp?asid=<%=answersheet.getAsId() %>&sid=<%=answersheet.getSurvey() %>>查看</a>|<a href="javascript:DelSheet(<%=answersheet.getAsId() %>,<%=answersheet.getSurvey() %>)">删除</a></td>
</tr>
 <%} %>
<tr> <td colspan=7 align="right"><%=pc.getCurrentPageHTML() %><%=pc.getCountPageHTML() %>|<%=pc.getFirstPageHTML() %>|<%=pc.getPageUpHTML() %>|<%=pc.getPageDownHTML() %>|<%=pc.getLastPageHTML() %></td></tr>--%>
</tbody>
 </table>

 <div class="pull-right">
	 <!-- 用于javascript提交，搜索内容 -->
	 <script type="text/javascript">
         function page(pageCode) {
             window.location.href = "${pageContext.request.contextPath}/surveyManage/ShowSheets/${sid}?pageCode="
                 + pageCode;
         }
	 </script>
	 <jsp:include page="/page.jsp"></jsp:include>
 </div>
  </body>
</html>
